package com.cu.employmentmanagementsystem.common.enums;

import lombok.Getter;

@Getter
public enum WxChatMsgTypeEnum
{
    SUBSCRIBE("event.subscribe","用户关注事件"),
    TEXT_MSG("text","文本消息"),
    IMAGE_MSG("image","图片消息"),
    VOICE_MSG("voice","语音消息"),
    VIDEO_MSG("video","视频消息"),
    LOCATION_MSG("location","地理位置消息"),
    LINK_MSG("link","链接消息"),
    EVENT_MSG("event","事件消息"),
    UNKNOWN_MSG("unknown","未知消息");

    private String type;
    private String desc;

    WxChatMsgTypeEnum(String type, String desc){
        this.type = type;
        this.desc = desc;
    }

     public static WxChatMsgTypeEnum getEnumByType(String type){
        for (WxChatMsgTypeEnum wxChatMsgTypeEnum : WxChatMsgTypeEnum.values()) {
            if(wxChatMsgTypeEnum.getType().equals(type)){
                return wxChatMsgTypeEnum;
            }
        }
        return null;
     }
}
